<template>
  <div>
    <el-row :gutter="15">
      <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
        <el-form-item label="用户" prop="roleId">
          <BeeSelect v-model="formData.roleId" dict-code="menuDict" />
        </el-form-item>
        <el-form-item size="large">
          <el-button type="primary" @click="submitForm">提交</el-button>
          <el-button @click="resetForm">重置</el-button>
        </el-form-item>
      </el-form>
    </el-row>
  </div>
</template>
<script>
import BeeSelect from '@/components/BeeSelect/index.vue'

export default {
  name: 'Test',
  components: { BeeSelect },
  props: [],
  data() {
    return {
      userid: undefined,
      formData: {
        roleId: undefined
      },
      rules: {
        roleId: [{
          required: true,
          message: '请选择用户',
          trigger: 'change'
        }]
      }}
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    submitForm() {
      console.log(this.formData)
      this.$refs['elForm'].validate(valid => {
        if (!valid) return
        // TODO 提交表单
      })
    },
    resetForm() {
      this.$refs['elForm'].resetFields()
    }
  }
}

</script>
<style>
</style>
